const sequelize = require('sequelize');

module.exports = app => {
    const { STRING, INTEGER } = app.Sequelize;

    const User = app.model.define('user', {
        id: { type: sequelize.INTEGER, primaryKey: true, autoIncrement: true },
        name: sequelize.STRING(1234),
        password: sequelize.STRING(1234),
        nickname: {
            type: STRING
        },
        score: {
            type: INTEGER,
            defaultValue: 0
        },
        level: {
            type: INTEGER,
            defaultValue: 0
        },
        phone: {
            type: STRING,
            defaultValue: ""
        },
        email: {
            type: STRING,
            defaultValue: ""
        },
        status: {
            type: INTEGER,
            defaultValue: 1
        },
        moneys: {
            type: INTEGER,
            defaultValue: 0
        },
        roleId: {
            type: INTEGER,
            defaultValue: 0
        },
        portrait: {
            type: STRING,
            defaultValue: ""
        }
    });
    return User;
};